const net = require('net')

const client = net.createConnection({ port: 9876, host: 'localhost' })

client.write('Hello, server!')

client.on('data', (buffer) => {
    console.log(buffer.toString())
})